/*
 * Created on 30.01.2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ro.qi.framework.sys.entities.components;

import ro.qi.framework.sys.entities.exception.ComponentException;
import ro.qi.framework.sys.hash.Challenge;

/**
 * @author Vlad Lepadatu
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class AutoGeneratedIdComponent extends IdComponent {

	/**
	 * @see ro.qi.framework.entities.components.IdComponent#getValue()
	 */
	public Object getValue() {
		if( value == null ) {
			try {
				setValue(new Integer(Challenge.generateId(9)));
			} catch (NumberFormatException e) {
			} catch (ComponentException e) {}
		}
		return super.getValue();
	}

}
